package com.mylogistics.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;

@Getter
@Setter
@TableName("user")
public class User {
    @ExcelProperty("用户编号")
    @TableId(type = IdType.AUTO)
    Integer uid;
    @ExcelProperty("用户账号")
    @NotEmpty(message = "用户名不可以为空")
    @TableField("username")
    String username;
    @ExcelIgnore
    @Size(min = 6,max = 15,message = "密码长度最小为6，最大为15")
    @NotEmpty(message = "密码不可以为空")
    @TableField("password")
    String password;
    @ExcelProperty("用户角色")
    @TableField("role")
    String role;
    @ExcelProperty("用户真实姓名")
    @TableField("truename")
    String truename;
}
